Repository navigation
Measure coverage in API servers started by client tests - #548
Merged
Merged
Conversation
The client tests run the compute and user APIs under uvicorn in forked processes, which coverage didn't measure, and stop them with SIGTERM before they could save any data. Code reached only over HTTP, such as most compute manager endpoints, was reported as uncovered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TzQGiBpTqsvrNituexCQB1
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #548 +/- ##
===========================================
+ Coverage 81.03% 91.49% +10.45%
===========================================
Files 31 31
Lines 4963 5011 +48
===========================================
+ Hits 4022 4585 +563
+ Misses 941 426 -515 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coverage reports miss most of the compute and user API code, because the client tests run those servers in forked processes that coverage never measures. On #541, Codecov reported 7% patch coverage for
compute/api.py, although the new endpoints are exercised by the client tests.running_serviceforks amultiprocessing.Processrunning uvicorn and stops it withterminate(). Recent pytest-cov leaves subprocess measurement to coverage.py's own settings, and[tool.coverage.run]set none, so the server processes weren't measured; and SIGTERM killed them before they could save data anyway.This sets
concurrency = ["thread", "multiprocessing"],parallel = trueandsigterm = true. pytest-cov combines the data files itself, so the CI workflow is unchanged.Running
tests/integration/compute/clientandtests/integration/interface/clientlocally:compute/api.pyinterface/api.pybase/api.py🤖 Generated with Claude Code
https://claude.ai/code/session_01TzQGiBpTqsvrNituexCQB1